-- 32 bit version program counter
-- bowmanb

library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;

entity pcExtAdd is
  port
    (
      -- Write data input port    
      offset   : in  std_logic_vector (31 downto 0);
      pcin : in std_logic_vector (31 downto 0);
      -- read port 2
      pcout  : out std_logic_vector (31 downto 0)
      );
end pcExtAdd;

architecture pcExtAdd_arch of pcExtAdd is

  signal ovf : std_logic;
  signal S : std_logic_vector(31 downto 0);

  component adder
    port (
      Cin      : in  std_logic;
      A        : in  std_logic_vector(31 downto 0);
      B        : in  std_logic_vector(31 downto 0);
      Sum      : out std_logic_vector(31 downto 0);
      Overflow : out std_logic);
  end component;
  
begin
  add_c : adder port map (
    Cin => '0', A => offset, B => pcin, Sum => S, overflow => ovf);

  pcout <= S;
end pcExtAdd_arch;
